import TestApi from "@/api/testApi";

export const useHomeStore = defineStore("home", {
  state: () => ({
    count: 100,
    bannerList: [],
  }),
  getters: {
    inceremnt() {
      return (this as any).count + 100;
    },
  },
  actions: {
    async getBannerList() {
      const res = await TestApi.getBannerList();
      // console.log(res.data);

      // 添加类型断言以解决 res 类型未知的问题
      this.bannerList = (res as any).data;
    },
  },
  persist: true,
});
